//
//  FWContentMediaView.m
//  BirdLoveSheep
//
//  Created by wwj on 16/3/28.
//  Copyright © 2016年 wwj. All rights reserved.
//

#import "FWContentMediaView.h"
#import <UIImageView+WebCache.h>
#import "FWTopicModel.h"

@interface FWContentMediaView ()
@property (weak, nonatomic) IBOutlet UILabel *playCountLabel;
@end

@implementation FWContentMediaView

- (void)setModel:(FWTopicModel *)model{
    [super setModel: model];
    self.playCountLabel.text = [NSString stringWithFormat:@"%d播放", model.playcount];
    [self.imageView sd_setImageWithURL:[NSURL URLWithString:self.model.image2] placeholderImage:nil completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) {
        if (model.isBigVideoImg) {
            self.imageView.contentMode = UIViewContentModeScaleAspectFit;
        }else {
            self.imageView.contentMode = UIViewContentModeScaleToFill;
        }
    }];
}

@end
